/**
 * 
 */
package com.nwpusp.display.resmgr;

import com.nwpusp.display.views.components.Animal;
import com.nwpusp.display.views.components.GameProcessBarHeader;

import android.content.Context;
import android.util.Log;
import android.view.View;

/**
 * @author JustinCao
 *
 */
public class AnimalProcessViewResManager extends ViewResourceManager {

	@Override
	protected View allocView(Object[] param) {
		Context contextView = (Context) param[0];
		Float height = (Float) param[1];
		Integer index = (Integer)param[2];
		return new GameProcessBarHeader(contextView, height.floatValue(), index.intValue());
	}

	@Override
	protected View searchView(Object[] param) {
		if(isEmpty())
			return null;
		GameProcessBarHeader ani = null;
		for(Object obj : this) {
			ani = (GameProcessBarHeader)obj;
			if(ani.getIndex() == ((Integer)param[2]).intValue()) {
				this.remove(ani);
				break;
			}
			else {
				ani = null;
			}
		}
		return ani;
	}
}
